package com.topvision.myviewtest.utils;

import android.util.Log;

import com.topvision.myviewtest.BuildConfig;

/**
 *
 * @author lucy
 * @date 2017/6/1
 */

public class LogUtils {

    private static final int VERBOSE = 1;

    private static final int DEBUG = 2;

    private static final int INFO = 3;

    private static final int WARN = 4;

    private static final int ERROR = 5;

    private static final int NOTHING = 6;

    //测试时LEVEL=VERBOSE,上架后LEVEL=NOTHING
    private static final int LEVEL = BuildConfig.DEBUG ? VERBOSE : NOTHING;

    public static void v(String tag,String msg){
        if (LEVEL <= VERBOSE){
            Log.v(tag,msg);
        }
    }

    public static void d(String tag,String msg){
        if (LEVEL <= DEBUG){
            Log.d(tag, msg);
        }
    }

    public static void i(String tag,String msg){
        if (LEVEL <= INFO){
            Log.i(tag, msg);
        }
    }

    public static void w(String tag,String msg){
        if (LEVEL <= WARN){
            Log.w(tag, msg);
        }
    }

    public static void e(String tag,String msg){
        if (LEVEL <= ERROR){
            Log.e(tag,msg);
        }
    }


}
